package com.example.application9.bean;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

/**
 {

 "results": [

 {

 "location": {

 "id": "WX4FBXXFKE4F",

 "name": "北京",

 "country": "CN",

 "path": "北京,北京,中国",

 "timezone": "亚洲/上海",

 "timezone_offset": "+08:00"

 },

 "now": {

 "text": "晴",

 "code": "1",

 "温度": "21"

 },

 "last_update": "2025-05-11T20:20:20+08:00"

 }

 ]

 }
 */
public class WeatherBean implements Serializable {
    private List<Result> results;

    public List<Result> getResults() { return results; }
    public void setResults(List<Result> results) { this.results = results; }

    public static class Result {
        private Location location;
        private Now now;
        @SerializedName("last_update")
        private String lastUpdate;

        // Getter & Setter
        public Location getLocation() { return location; }
        public void setLocation(Location location) { this.location = location; }
        public Now getNow() { return now; }
        public void setNow(Now now) { this.now = now; }
        public String getLastUpdate() { return lastUpdate; }
        public void setLastUpdate(String lastUpdate) { this.lastUpdate = lastUpdate; }
    }

    public static class Location {
        private String id;
        private String name;
        private String country;
        private String path;
        private String timezone;
        @SerializedName("timezone_offset")
        private String timezoneOffset;

        // Getter & Setter
        public String getId() { return id; }
        public void setId(String id) { this.id = id; }
        public String getName() { return name; }
        public void setName(String name) { this.name = name; }
        public String getCountry() { return country; }
        public void setCountry(String country) { this.country = country; }
        public String getPath() { return path; }
        public void setPath(String path) { this.path = path; }
        public String getTimezone() { return timezone; }
        public void setTimezone(String timezone) { this.timezone = timezone; }
        public String getTimezoneOffset() { return timezoneOffset; }
        public void setTimezoneOffset(String timezoneOffset) { this.timezoneOffset = timezoneOffset; }
    }

    public static class Now {
        private String text;
        private String code;
        @SerializedName("temperature")
        private String temperature;

        // Getter & Setter
        public String getText() { return text; }
        public void setText(String text) { this.text = text; }
        public String getCode() { return code; }
        public void setCode(String code) { this.code = code; }
        public String getTemperature() { return temperature; }
        public void setTemperature(String temperature) { this.temperature = temperature; }
    }
}